<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkflowTemplatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('workflow_templates', function (Blueprint $table) {
            $table->id();
            $table->string('name', 32)->default('')->comment('模板名称');
            $table->unsignedTinyInteger('workflowType')->default(0)->comment('工作流类型 1续签 99其他');
            $table->unsignedTinyInteger('status')->default(0)->comment('0停用 1启用');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger('isDeleted')->default(0);
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '工作流 - 模板表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('workflow_templates');
    }
}
